/*------------ Create By Suriyakamol ---------*/

//-------------- Hidden Menu ---------------

function hide_menu(id_element){
	document.getElementById("sub_tr_"+id_element).style.display="none";
	document.getElementById("mn_tr_"+id_element).onclick=function(){ show_menu(id_element); }
}

function show_menu(id_element){
	document.getElementById("sub_tr_"+id_element).style.display="";
	document.getElementById("mn_tr_"+id_element).onclick=function(){ hide_menu(id_element); }
}

//------------- Show Menu ---------------

function goto_page(dir_element){
	var req=Inint_AJAX();
	var url=null;
	var value_url=null;

	url=dir_element+'.php';
	value_url='hash='+new Date().getTime()+Math.random();
	fn_delete_img(); 

	req.open("POST", url, true);
			req.onreadystatechange = function() {
					if (req.readyState==4) {
						if (req.status==200) {
							var data=eval(req.responseText);
							document.getElementById("show_data").innerHTML=data[0].result_data;
							/*if(dir_element != "product"){
								fn_delete_img();
							}*/
							load_main();
						}
					}
			};
	req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); // setHeader charset=tis-620
	req.send(value_url);
}